package com.yang.concurrent.raw.base;

import java.util.concurrent.*;

/**
 * @description:todo
 * @auth yangzhiwei
 * @date 2021-04-26 21:59
 */

public class ThreadTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        MyThread thread = new MyThread();
        //start 方法会使得当前虚拟机多一个可执行的栈帧
        thread.start();

        Callable callable;
        //new Thread(new Callable<>())
        ThreadPoolExecutor executor = new ThreadPoolExecutor(3,10,10, TimeUnit.MINUTES,new ArrayBlockingQueue<>(10));
       Future future =  executor.submit(new MyCallable());
       future.cancel(true);
        System.out.println(future.isCancelled());
        System.out.println(future.isDone());
        executor.shutdown();
        //System.out.println(future.get());
        FutureTask futureTask ;
    }
}
